evtchn: rearrange fields
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 1 Apr 2014 16:22:40 +0000 (18:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 1 Apr 2014 16:22:40 +0000 (18:22 +0200)
commitfd17ce9bb46f859853a4f2e8c48b2e537906a4d5
tree2689fb6cd122d8bbf8d2784cb9429ef134c1fc42
parent3be448811f3702a5b52a21d0a55683c018122759
evtchn: rearrange fields

Event channel arrays are allocated in blocks with EVTCHNS_PER_BUCKET
elements, which must be a power of 2.  When XSM is disabled, struct
evtchn is 32 bytes including padding; however, when XSM is enabled, the
structure becomes larger and EVTCHNS_PER_BUCKET is halved.  Rearranging
some of the fields in struct evtchn allows a 4-byte XSM field to fit
within the 32-byte structure.

This rearrangement turns the xen_consumer field of struct evtchn into a
bitfield and adjusts the xen_consumers array to fit the number of
addressable elements from this value.  Since there are currently only
two users of this array, only 3 bits (7 values) are reserved.  This
field is also used rarely enough that the slight overhead from applying
a bitmask should not cause problems.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/common/event_channel.c
xen/include/xen/sched.h